package com.cn.serverline.lineicp.productionLine.param;

import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 产品类型和产品型号添加参数
 *
 * @author Gmr
 * @since 2024/7/30
 */
@Data
public class ProductsAddParam {

	/**
	 * 产品类型或者型号名称
	 */
	@ApiModelProperty(value = "名称", required = true)
	@ChineseDescription("名称")
	@NotBlank(message = "名称不能为空")
	@Size(max = 30, message = "名称长度不能超过30")
	private String name;

	/**
	 * 父ID
	 */
	@ApiModelProperty(value = "父ID", required = true)
	@JsonSerialize(using= ToStringSerializer.class)
	@ChineseDescription("父ID")
	@NotNull(message = "父ID不能为空")
	private Long parentId;
	/**
	 * 类型(0.大类,1.二级类,2.型号)
	 */
	@ApiModelProperty(value = "类型(0.大类,1.二级类,2.型号)", required = true)
	@ChineseDescription("类型")
	@NotNull(message = "类型不能为空")
	private Long category;


	/**
	 * 零组件代号
	 */
	@ApiModelProperty(value = "零组件代号")
	@ChineseDescription("零组件代号")
	@Size(max = 50, message = "零组件代号长度不能超过50")
	private String componentCode;
}
